package com.bear.fastrepair.http.api

import com.bear.fastrepair.entity.*
import retrofit2.http.*

/**
 * 员工API
 */
interface ManageEmployeeService {
    /**
     * 新增员工
     * @param employeeInfo [EmployeeInfo] 员工信息
     * @return ResponseInfo
     */
    @POST("employee")
    suspend fun addEmployee(@Body employeeInfo: EmployeeInfo): ResponseInfo

    /**
     * 分页查询员工
     * @param current Int 当前页，1开始
     * @param size Int 每页条数
     * @param account String 账号
     * @param regionCode String 区域编码
     * @param tel String 电话号码
     * @param userName String 用户名
     * @return [EmployeePageInfo]
     */
    @GET("employee/page")
    suspend fun getEmployeeInfoPage(
        @Query("current") current: Int,
        @Query("size") size: Int,
        @Query("account") account: String = "",
        @Query("regionCode") regionCode: String = "",
        @Query("tel") tel: String = "",
        @Query("userName") userName: String
    ): EmployeePageInfo

    /**
     * 通过 [id] 查询员工
     * @param id String
     * @return [EmployeeInfoAndStatusResponse]
     */
    @GET("employee/{id}")
    suspend fun getEmployeeInfoByID(@Path("id") id: String): EmployeeInfoAndStatusResponse

    /**
     * 通过 [id] 修改员工
     * @param employee [ModifyEmployee]
     * @param id String
     * @return ResponseInfo
     */
    @PUT("employee/{id}")
    suspend fun modifyEmployeeInfo(
        @Body employee: ModifyEmployee,
        @Path("id") id: String
    ): ResponseInfo

    /**
     * 通过 [id] 删除员工
     * @param id String
     * @return ResponseInfo
     */
    @DELETE("employee/{id}")
    suspend fun deleteEmployeeByID(@Path("id") id: String): ResponseInfo
}